package com.f5.management.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Random;
import java.util.logging.Handler;

/**
 * 对应人员管理表，此表关联业主和用户
 *
 */
@Data
@AllArgsConstructor
public class Member {
    private int id;//自动递增
    private RealEstate realEstate;//房产 rid

    private Community community;//小区  cid
    private String memberName;//名字
    private String idCard;//身份证
    private String phone;//电话 char(18)
    private String job;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT"+24)
    private Date   birth; //
    private char sex; // NOT NULL
    private String desc;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT"+24)
    private Date createTime; //NOT NULL
    private  int  type;// NOT NULL
    private int status; // 0 有效  1 失效  NOT NULL
    private BigDecimal balance;//余额



    public Member() {
        double random = Math.random();
        if(random > 0.5) {
            this.id = 1;
        } else {
            this.id = 2;
        }
    }
}
